<!--  -->
<template>
  <div>
    <section class="jumbotron">
      <h3 class="jumbotron-heading">搜索GitHub用户</h3>
      <div>
        <input type="text"
               placeholder="输入搜索名"
               v-model="val" />&nbsp;<button @click="search">搜索</button>
      </div>
    </section>
  </div>
</template>

<script>
export default {
  data () {
    return {
      val: ""
    }
  },
  methods: {
    search () {
      this.$emit('search', this.val)
    }
  },
  //生命周期 - 创建完成（访问当前this实例）
  created () {

  },
  //生命周期 - 挂载完成（访问DOM元素）
  mounted () {

  }
}
</script>
<style scoped>
</style>